package com.cyf.service;

import com.cyf.db.bean.PayOrder;
import com.cyf.util.PayOrderMessageList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


/**
 * 消息队列
 * Created by cage on 2017/2/28.
 */
@Component
public class MsgListScheduleTask {

    @Autowired
    private PayOrderService payOrderService;

    // 向车场下发支付信息，车场在入场信息中保存
    @Scheduled(cron = "*/2 * * * * *")
    public void checkPayOrderMessageList() {
        PayOrder payOrder = PayOrderMessageList.getPayOrderMessage();
        if (null == payOrder) {
            return;
        }
        payOrderService.sendPayOrder(payOrder);
        /*if (PayOrder.FEETYPE_RECHARGE != payOrder.getFeeType()) {
            payOrderService.sendPayOrder(payOrder);
        } else {
            payOrderService.sendRechargeMessage(payOrder);
        }*/
    }

}
